package com.fmc123.base.modules.entity ;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.fmc123.base.pesistence.BaseEntity;
/**
* @ClassName: SysUser
* @Description: 系统用户Entity 
* @author fmc
* @date 2015年11月14日下午3:21:46
*
 */
@Entity
@Table(name = "sys_user" )
public class SysUser extends BaseEntity {
    
    private static final long serialVersionUID = 1L;
    
    /**
     * 账号
     */
    @Column(name = "ACCOUNT" ,length = 255 ,nullable = false)  
    private String account ;
    
    /**
     * 用户名
     */
    @Column(name = "USERNAME" ,length = 50 ,nullable = false)  
    private String username ;
    
    /**
     * 密码
     */
    @Column(name = "PASSWORD" ,length = 255 ,nullable = false)  
    private String password ;
    
    /**
     * 邮箱
     */
    @Column(name = "EMAIL" ,length = 100)  
    private String email ;
    
    /**
     * 手机号
     */
    @Column(name = "PHONE" ,length = 20)  
    private String phone ;
    
    /**
     * 状态
     */
    @Column(name = "STATE" ,length = 5)  
    private Integer state ;
    
    /**
     * 级别
     */
    @Column(name = "LEVEL" ,length = 5)  
    private Integer level ;
    
    /**
     * 注册时间
     */
    @Column(name = "CREATE_DATE" ,nullable = false)  
    @javax.persistence.Temporal(javax.persistence.TemporalType.TIMESTAMP)
    private java.util.Date createDate ;
    
    /**
     * 登录时间
     */
    @Column(name = "LOGIN_DATE")  
    @javax.persistence.Temporal(javax.persistence.TemporalType.TIMESTAMP)
    private java.util.Date loginDate ;
    
    /**
     * 登录ip
     */
    @Column(name = "LOGIN_IP" ,length = 100)  
    private String loginIp ;
    
    /**
     * 用户角色
     */
    @OneToMany(fetch=FetchType.LAZY,mappedBy="user",targetEntity=SysUserRole.class)
    private List<SysUserRole> userRoles=new ArrayList<SysUserRole>();
    
    public void setAccount (String account){
        this.account = account ;
    }
    public String getAccount (){
        return this.account ;
    }
     
    public void setUsername (String username){
        this.username = username ;
    }
    public String getUsername (){
        return this.username ;
    }
     
    public void setPassword (String password){
        this.password = password ;
    }
    public String getPassword (){
        return this.password ;
    }
     
    public void setEmail (String email){
        this.email = email ;
    }
    public String getEmail (){
        return this.email ;
    }
     
    public void setPhone (String phone){
        this.phone = phone ;
    }
    public String getPhone (){
        return this.phone ;
    }
     
    public Integer getState() {
      return state;
    }
    public void setState(Integer state) {
      this.state = state;
    }
    public Integer getLevel() {
      return level;
    }
    public void setLevel(Integer level) {
      this.level = level;
    }
    public void setCreateDate (java.util.Date createDate){
        this.createDate = createDate ;
    }
    public java.util.Date getCreateDate (){
        return this.createDate ;
    }
     
    public void setLoginDate (java.util.Date loginDate){
        this.loginDate = loginDate ;
    }
    public java.util.Date getLoginDate (){
        return this.loginDate ;
    }
     
    public void setLoginIp (String loginIp){
        this.loginIp = loginIp ;
    }
    public String getLoginIp (){
        return this.loginIp ;
    }
    public List<SysUserRole> getUserRoles() {
      return userRoles;
    }
    public void setUserRoles(List<SysUserRole> userRoles) {
      this.userRoles = userRoles;
    }
   
    
     
}